<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新增供应商</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<style type="text/css">
    body{ font-size:12px;}
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-test{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
    .l-verify-tip{ left:230px; top:120px;}
    .p-tab .s-lab{font-size:12px;font-family:"微软雅黑",​"宋体",​Arial,​sans-serif;}
	input.l-textarea{width:170px;height:20px;font-size:12px;}
	.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
</style>
</head>
<body style="padding:10px">
<div class="navbar">
		<span>您当前的位置：</span>
		基础数据管理 &gt;供应商管理 &gt;查看供应商
</div>
<form name="form1" method="post" action="u_supplierInfo.do" id="form1">
<br>
<table cellpadding="0" cellspacing="0" class="l-table-edit p-tab" >
    <tr>
        <td align="right" class="l-table-edit-td s-lab">供应商名称:</td>
        <td align="left" class="l-table-edit-td s-lab"><input name="supName"  type="text" disabled='disabled'   class="l-textarea" id="supName" value="${SupplierInfo.supName}"   validate="{required:true,minlength:1,maxlength:20}" /></td>
        <td align="left"></td>
    </tr>
     <tr>
        <td align="right" class="l-table-edit-td s-lab">供应商简称:</td>
        <td align="left" class="l-table-edit-td s-lab"><input name="supShortName" type="text" disabled='disabled'  class="l-textarea" id="supShortName" value="${SupplierInfo.supShortName}"  validate="{required:true,minlength:1,maxlength:20}" /></td>
        <td align="left"></td>
    </tr>
     <tr>
        <td align="right" class="l-table-edit-td s-lab">供应商编号:</td>
        <td align="left" class="l-table-edit-td s-lab"><input name="supCode" type="text"  class="l-textarea"  disabled='disabled'  id="supCode" value="${SupplierInfo.supCode}"  validate="{required:true,minlength:1,maxlength:20}" /></td>
        <td align="left"></td>
    </tr>
    <tr>
        <td align="right" class="l-table-edit-td s-lab">联系人:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="linkman" type="text" name="linkman"  value="${SupplierInfo.linkman}" disabled='disabled'   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
    <tr>
        <td align="right" class="l-table-edit-td s-lab">固定电话:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="telephoneNum" type="text" name="telephoneNum" value="${SupplierInfo.telephoneNum}" disabled='disabled'   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
     <tr>
        <td align="right" class="l-table-edit-td s-lab">手机号码:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="mobileNhonenum" type="text" name="mobileNhonenum" value="${SupplierInfo.mobileNhonenum}" disabled='disabled'   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
     <tr>
        <td align="right" class="l-table-edit-td s-lab">电子邮箱:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="email" type="text" name="email"  value="${SupplierInfo.email}"  class="l-textarea" disabled='disabled'  validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
     <tr>
        <td align="right" class="l-table-edit-td s-lab">合同日期:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="contractDay" type="text" name="contractDay" value="${SupplierInfo.contractDay}"  disabled='disabled'  class="l-textarea"  validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
       <tr>
        <td align="right" class="l-table-edit-td s-lab">联系地址:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="address" type="text" name="address" value="${SupplierInfo.address}" disabled='disabled'   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">
        </td><td align="left"></td>
    </tr>
    <c:forEach items="${supplierAccountsList}" var="item">
       <c:if test="${item.accountsType=='2'}">
        <tr>
        <td align="right" class="l-table-edit-td s-lab">代销结算:</td>
    </tr>
      <c:if test="${item.accountsWay=='1'}">
       <tr>
        <td align="right" class="l-table-edit-td s-lab">结算方式</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input  value="扣点" disabled='disabled'   class="l-textarea" >
        </td><td align="left"></td>
     </tr>
      <tr>
        <td align="right" class="l-table-edit-td s-lab">扣点比例</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="pointsScale" type="text" name="pointsScale" disabled='disabled'  value="${item.pointsScale}"   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">%
        </td><td align="left"></td>
          <tr>
        <td align="right" class="l-table-edit-td s-lab">结算周期（每月）</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="accountsTime" disabled='disabled'  type="text" name="accountsTime" value="${item.accountsTime}"   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">日
        </td><td align="left"></td>
     </tr>
    </tr>
    </c:if>
    
     <c:if test="${item.accountsWay=='2'}">
       <tr>
        <td align="right" class="l-table-edit-td s-lab">结算方式</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input  value="底价" disabled='disabled'   class="l-textarea" >
        </td><td align="left"></td>
      </tr>
      <tr>
        <td align="right" class="l-table-edit-td s-lab">结算周期（每月）</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="accountsTime" type="text" name="accountsTime"  disabled='disabled'  value="${item.accountsTime}"  class="l-textarea" >日
        </td><td align="left"></td>
    </tr>
    </c:if>  
    </c:if>
 
    <c:if test="${item.accountsType==1}">
        <tr>
        <td align="right" class="l-table-edit-td s-lab">购销结算:</td>
      </tr>
      <tr>
        <td align="right" class="l-table-edit-td s-lab">结算周期（每月）</td>
        <td align="left" class="l-table-edit-td s-lab"> 
        <input id="accountsTime" type="text" name="accountsTime" disabled='disabled'  value="${item.accountsTime}"   class="l-textarea" validate="{required:true,minlength:1,maxlength:20}">日
        </td><td align="left"></td>
     </tr>
     </c:if>
    </c:forEach>
</table>




<input type="button" value="返回" name="tests"  id="tests" class="l-button l-button-test" />
</form>
<div style="display:none">
<!--  数据统计代码 --></div>

<script type="text/javascript">
$(function ()
		{
			//validate
		    $.metadata.setType("attr", "validate");
		    var v = $("form").validate({
		        errorPlacement: function (lable, element)
		        {
		        	lable.ligerHideTip();
		            if (element.hasClass("l-textarea"))
		            {
		                element.ligerTip({ content: lable.html(), target: element[0] }); 
		            }
		            else if (element.hasClass("l-text-field"))
		            {
		                element.parent().ligerTip({ content: lable.html(), target: element[0] });
		            }
		            else
		            {
		                lable.appendTo(element.parents("td:first").next("td"));
		            }
		        }
		    ,
		        success: function (lable)
		        {
		            lable.ligerHideTip();
		            lable.remove();
		        },
		        submitHandler:function()
		        {
		            $("form .l-text,.l-textarea").ligerHideTip();
		            var options = {
		            		type: 'POST',
		            		beforeSend: function(){
		            			$("#form1").find(":submit,:button").attr("disabled", true);
		            		},
		            		success: function(data){
		            			if(data=="success") {
		            				window.parent.f_tip('修改成功');
		           					close_liger_tab();
		            			} else {
		            				window.parent.f_tip('修改失败');
		            			}
		            		}
		            	}, $form1 = $("#form1");
		           $form1.ajaxSubmit(options);
		             return false;
		        }
		    });
		});  
//取消
$("#tests").click(function() {
	close_liger_tab();
});
</script>
</body>
</html>